%% Plots for limited commitment
model_pick = 'lc';

V = eval(['V_',model_pick]);
Beta = eval(['Beta_',model_pick]);
C = eval(['C_',model_pick]);
K = eval(['K_',model_pick]);

vol_c = eval(['vol_c_',model_pick]);

Suff = eval(['Suff_',model_pick]);

%% Create variables
epsilon_C = (vol_c./C + Beta)/sigma;

%% Formatting parameters
paperposition = [0 0 8 4.5];
definition = '-r500';
axis_font = 6;
label_font = 10;
legend_font = 8;

edgecolor = 'k';

linewidth = 1;

color1 = 'b';
color2 = 'r';
color3 = [0.4940 0.1840 0.5560];

marker1 = 'o';
marker2 = '^';
marker3 = '*';

marker_size = 5.5;

marker_spacing = [1:20:n_grid];


%% INTERPOLANTS

V_FUN = griddedInterpolant(PHI,V);

C_FUN = griddedInterpolant(PHI,C);
K_FUN = griddedInterpolant(PHI,K);
Beta_FUN = griddedInterpolant(PHI,Beta);

epsilon_C_FUN = griddedInterpolant(PHI,epsilon_C);


Suff_FUN = griddedInterpolant(PHI,Suff);

%% V
VAR1 = V_FUN(PHI);
ymin = nanmin(VAR1);
ymax = nanmax(VAR1);
figure;
hold on
l1 = plot(PHI, VAR1, 'Color', color1, 'LineWidth', linewidth);
ylim([ymin ymax])
set(gca,'FontSize',axis_font);
Xla=xlabel('Beliefs ($$\phi$$)','Interpreter','Latex','FontSize',label_font);
set(Xla, 'Units', 'Normalized');
Yla=ylabel('Dual cost function ($$g$$)','Interpreter','Latex','FontSize',label_font);
set(Yla, 'Units', 'Normalized');
set(gcf,'PaperUnits','centimeters')
set(gcf, 'PaperPosition', paperposition);
print('-dpng',gcf,['V_',model_pick,'.png'],'-r500');
hold off; clear h; close;


%% Beta
VAR1 = Beta_FUN(PHI);
ymin = nanmin(VAR1);
ymax = nanmax(VAR1);
figure;
hold on
l1 = plot(PHI, VAR1, 'Color', color1, 'LineWidth', linewidth);
ylim([ymin ymax])
set(gca,'FontSize',axis_font);
Xla=xlabel('Beliefs ($$\phi$$)','Interpreter','Latex','FontSize',label_font);
set(Xla, 'Units', 'Normalized');
Yla=ylabel('Incentives ($$\hat{\beta}$$)','Interpreter','Latex','FontSize',label_font);
set(Yla, 'Units', 'Normalized');
set(gcf,'PaperUnits','centimeters')
set(gcf, 'PaperPosition', paperposition);
print('-dpng',gcf,['Beta_',model_pick,'.png'],'-r500');
hold off; clear h; close;


%% C
VAR1 = C_FUN(PHI);
ymin = nanmin(VAR1);
ymax = nanmax(VAR1);
figure;
hold on
l1 = plot(PHI, VAR1, 'Color', color1, 'LineWidth', linewidth);
ylim([ymin ymax])
set(gca,'FontSize',axis_font);
Xla=xlabel('Beliefs ($$\phi$$)','Interpreter','Latex','FontSize',label_font);
set(Xla, 'Units', 'Normalized');
Yla=ylabel('Compensation ratio ($$c$$)','Interpreter','Latex','FontSize',label_font);
set(Yla, 'Units', 'Normalized');
set(gcf,'PaperUnits','centimeters')
set(gcf, 'PaperPosition', paperposition);
print('-dpng',gcf,['C_',model_pick,'.png'],'-r500');
hold off; clear h; close;


%% K
VAR1 = K_FUN(PHI);
ymin = nanmin(VAR1);
ymax = nanmax(VAR1);
figure;
hold on
l1 = plot(PHI, VAR1, 'Color', color1, 'LineWidth', linewidth);
ylim([ymin ymax])
set(gca,'FontSize',axis_font);
Xla=xlabel('Beliefs ($$\phi$$)','Interpreter','Latex','FontSize',label_font);
set(Xla, 'Units', 'Normalized');
Yla=ylabel('Capital ratio ($$k$$)','Interpreter','Latex','FontSize',label_font);
set(Yla, 'Units', 'Normalized');
set(gcf,'PaperUnits','centimeters')
set(gcf, 'PaperPosition', paperposition);
print('-dpng',gcf,['K_',model_pick,'.png'],'-r500');
hold off; clear h; close;


%% VOL log C
%VOL log C
VAR1 = epsilon_C_FUN(PHI);
ymin = nanmin(VAR1);
ymax = nanmax(VAR1);
figure;
hold on
l1 = plot(PHI, VAR1, 'Color', color1, 'LineWidth', linewidth);
ylim([ymin ymax])
set(gca,'FontSize',axis_font);
Xla=xlabel('Beliefs ($$\phi$$)','Interpreter','Latex','FontSize',label_font);
set(Xla, 'Units', 'Normalized');
Yla=ylabel('Pay-perfor. sens. ($$\epsilon_C$$)','Interpreter','Latex','FontSize',label_font);
set(Yla, 'Units', 'Normalized');
set(gcf,'PaperUnits','centimeters')
set(gcf, 'PaperPosition', paperposition);
print('-dpng',gcf,['epsilon_C_',model_pick,'.png'],'-r500');
hold off; clear h; close;

%% Suff
VAR1 = Suff_FUN(PHI);
ymin = nanmin(VAR1);
ymax = nanmax(VAR1);
figure;
hold on
l1 = plot(PHI, VAR1, 'Color', color1, 'LineWidth', linewidth);
ylim([ymin ymax])
set(gca,'FontSize',axis_font);
Xla=xlabel('Beliefs ($$\phi$$)','Interpreter','Latex','FontSize',label_font);
set(Xla, 'Units', 'Normalized');
Yla=ylabel('$$\frac{\omega - \eta(1-2\phi)\xi}{v^{1-\rho}}$$','Interpreter','Latex','FontSize',label_font);
set(Yla, 'Units', 'Normalized');
set(gcf,'PaperUnits','centimeters')
set(gcf, 'PaperPosition', paperposition);
print('-dpng',gcf,['Suff_',model_pick,'.png'],'-r500');
hold off; clear h; close;

